<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ax="urn:aspxslt:handling" exclude-result-prefixes="ax">
    <xsl:output method="html"/>
    <xsl:template match="/">
        <html xmlns="http://www.w3.org/1999/xhtml">
            <head>
                <xsl:apply-templates select="." mode="head" />
            </head>
            <body>
                <xsl:apply-templates select="." mode="intro" />
                <xsl:apply-templates select="." mode="contents" />
                <xsl:apply-templates select="." mode="footer" />
            </body>
        </html>
    </xsl:template>
    
    <xsl:template match="/" mode="head">
        <title>Page Title</title>
    </xsl:template>

    <xsl:template match="/" mode="intro">
        <div style="border: solid thin black">
            <h1>Intro</h1>
        </div>
    </xsl:template>

    <xsl:template match="/" mode="contents">
        <div style="border: solid thin black">
            <h1>Contents</h1>
        </div>
    </xsl:template>

    <xsl:template match="/" mode="footer">
        <div style="border: solid thin black">
            <h1>Footer</h1>
        </div>
    </xsl:template>

    <xsl:template match="ax:component[ax:error]">
        <div style="background-color:red">
            Error in component <xsl:value-of select="@type"/>
        </div>
    </xsl:template>
</xsl:stylesheet>